package com.kedacom.demo.spring.websocket.rpc;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.stereotype.Component;

@Component("pendingRequestHolder")
public class PendingRequestHolder {

	private final Map<String, PendingRequest> pendingRequests = new ConcurrentHashMap<String, PendingRequest>();

	public void put(String requestId, PendingRequest pendingRequest) {
		pendingRequests.put(requestId, pendingRequest);
	}

	public PendingRequest get(String requestId) {
		return pendingRequests.get(requestId);
	}

	public PendingRequest remove(String requestId) {
		return pendingRequests.remove(requestId);
	}

}
